{% extends "../../base_with_nav.html" %}

{% load admin_utils %}


{% block navigation_header %}
<div class="paas-side-bar-title">
    <img src="{{ application.logo_url }}" class="overview-title-pic"/>
    <div class="overview-title-text">
        <bk-popover content="{{ application.name }}" placement="right">
            <div>{{ application.name }}</div>
        </bk-popover>
        <div>{{ application.code }}</div>
    </div>
</div>
{% endblock %}

{% block content_header %}
<ul class="paas-breadcrumb">
    <li><a href="{% url 'admin.front_page' %}">首页</a></li>
    <li><a href="{% url 'admin.platform.index' %}">平台管理</a></li>
    <li><a href="{% url 'admin.applications.list' %}">应用列表</a></li>
    <li><a href="{% url 'admin.applications.detail.overview' application.code %}">{{ application.name }}</a></li>
    <li class="active">{{ view.name }}</li>
</ul>
{% endblock %}

{% block nav_list %}
<script>
    var navList = [
        {
            name: '概览',
            icon: 'icon-tree-application-shape',
            url: '{% url "admin.applications.detail.overview" application.code %}',
            open: true
        },
        {
            name: '应用引擎',
            icon: 'icon-apps-shape',
            children: [
                {% url 'admin.applications.engine.custom_domain' application.code as custom_domain_view %}
                {% if custom_domain_view %}
                {
                    name: '独立域名',
                    url: '{% url "admin.applications.engine.custom_domain" application.code %}'
                },
                {% endif %}
                {
                    name: '进程管理',
                    url: '{% url "admin.applications.engine.process_specs" application.code %}'
                },
                {
                    name: '环境变量管理',
                    url: '{% url "admin.applications.engine.config_vars.manage" application.code %}'
                },
                {
                    name: '运行时管理',
                    url: '{% url "admin.applications.engine.runtime.manage" application.code %}'
                },
                {
                    name: '包版本管理',
                    url: '{% url "admin.applications.engine.source_packages.manage" application.code %}'
                },
                {
                    name: 'Egress 管理',
                    url: '{% url "admin.applications.engine.egress.manage" application.code %}'
                },
                {
                    name: '日志采集管理',
                    url: '{% url "admin.applications.engine.log_config.manage" application.code %}'
                },
            ]
        },
        {
            name: '增强服务',
            icon: 'icon-tree-module-shape',
            url: '{% url "admin.applications.services" application.code %}',
        },
        {% url 'admin.applications.access_control.user' application.code as access_control_view %}
        {% if access_control_view %}
        {
            name: '权限管理',
            icon: 'icon-apps-shape',
            children: [
                {
                    name: '用户限制',
                    url: '{% url "admin.applications.access_control.user" application.code %}'
                },
                {
                    name: 'IP限制',
                    url: '{% url "admin.applications.access_control.ip" application.code %}'
                },
            ]
        },
        {% endif %}
        {
            name: '基本设置',
            icon: 'icon-tree-process-shape',
            children: [
                {
                    name: '成员管理',
                    url: '{% url "admin.applications.detail.base_info.members" application.code %}'
                },
                {
                    name: '特性管理',
                    url: '{% url "admin.applications.detail.base_info.feature_flags" application.code %}'
                },
            ]
        }
    ]
</script>
{% endblock %}

{% block footer %}
{{ block.super }}
<style>
    .paas-side-bar:before{
        content: '';
        height: 0px;
        line-height: 48px;
        box-shadow: 0px 0px 0px 0px rgba(64, 112, 203, 0.06);
        border-bottom: 0px solid #dcdee5;
        display: block;
        padding-left: 25px;
        color: #526e8e;
    }
</style>
{% endblock %}
